<?php

declare(strict_types=1);

namespace App\Controller;

use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\RequestMapping;
use Psr\Http\Message\ResponseInterface;
use Hyperf\HttpServer\Annotation\Middleware;
use App\Middleware\UserAuthorizationMiddleware;
use App\Middleware\UserPermissionMiddleware;
use App\Service\Logic\EnumLogic;

/**
 * 枚举-控制器
 */
#[Controller(prefix: "/api/enum")]
#[Middleware(UserAuthorizationMiddleware::class)]
#[Middleware(UserPermissionMiddleware::class)]
class EnumController extends AbstractController
{
        #[Inject]
        protected EnumLogic $logic;

        /**
         * 查询
         * @return ResponseInterface
         */
        #[RequestMapping(path: "", methods: "get")]
        public function query(): ResponseInterface
        {
                return $this->response->json($this->logic->query());
        }
}